<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition>
	<f:event listener="#{faqController.init}" type="preRenderComponent"></f:event>
	<p:panel header="#{msgs.faq}">
		<p:dataGrid var="faq" value="#{faqModel.list}" columns="1"
			style="width:100%;height:500px">
			<p:column style="width:100%">
				<h:panelGrid columns="1" style="width:100%">
					<p:commandLink value="#{faq.questionLabel}" ajax="true"
						update=":centerForm" style="font-weight:bold;color:green">
						<f:setPropertyActionListener value="#{true}"
							target="#{faq.selected}" />
					</p:commandLink>
					<h:panelGroup>
						<p:outputPanel rendered="#{faq.selected}" autoUpdate="true">
							<h:inputTextarea
								style="overflow:auto;width:100%;height:150px;border:0px"
								value="#{faq.answerLabel}" rendered="#{faq.selected}"
								readonly="true"></h:inputTextarea>
						</p:outputPanel>
						<p:commandLink value="#{msgs.hide}" ajax="true"
							update=":centerForm" rendered="#{faq.selected}"
							style="color:blue;font-size:0.8em">
							<f:setPropertyActionListener value="#{false}"
								target="#{faq.selected}" />
						</p:commandLink>
					</h:panelGroup>
				</h:panelGrid>
			</p:column>
		</p:dataGrid>
	</p:panel>
</ui:composition>
</html>